/**
 *	\file AKHumanPlayer.m
 *  
 *  \section desc_sec Description
 *  Description
 *  
 *  \if copyright
 *  	Copyright 2008 Ben Chen. All rights reserved.
 *  \endif
 *  
 *  \section hist_sec Change History:
 *  	-	1/31/08		BC		Created this file
 *  
 *  <hr>
 *  \addtogroup AnimalKingdom
 *  @{
 */

#import "AKHumanPlayer.h"

@implementation AKHumanPlayer

@synthesize side, bestMove, window;

- (id)initWithWindow:(NSWindow*)aWindow
{
	self = [super init];
	if (self != nil)
	{
		self.window = aWindow;
	}
	return self;
}

- (void)setSide:(AKSideIndex)aSide
{
	side = aSide;
}

- (void)setBestMove:(AKMove)newMove
{
	bestMove = newMove;
}

- (void)backToInitialState
{
	// Nothing to do
}

- (BOOL)becomeFirstResponder
{
	return YES;
}

- (BOOL)resignFirstResponder
{
	return isThinking ? NO : YES;
}

- (BOOL)thinkNextMove
{
	BOOL retVal = NO;
	
	if (!isThinking && [self.window makeFirstResponder:self])
	{
		isThinking = retVal = YES;
	}
	
	return retVal;
}

- (void)stopThinking
{
}

- (BOOL)performMove:(AKMove)newMove
{
	// If someone tell us to perform a move, meanning that move should be correct
	return YES;
}

#pragma mark Mouse Events Handler

- (void)mouseMoved:(NSEvent *)theEvent
{
	// If cursor is on a move-able piece
	// 1 activate the piece
	// 2 nextEvent until mouse is out of the piece
}

- (void)mouseDown:(NSEvent *)theEvent
{
	// 
}

@end

/** @} */
